package com.shiningstars.tools;

import java.lang.Thread.UncaughtExceptionHandler;

import android.content.Context;

import com.shiningstars.general.Constants;
import com.shiningstars.general.Utilities;

public class ExceptionHandler implements UncaughtExceptionHandler, Constants {

	Context ctx;

	public ExceptionHandler(Context context) {
		ctx = context;
	}

	@Override
	public void uncaughtException(Thread thread, Throwable ex) {

		final Throwable t = ex;

		new Thread() {
			public void run() {
				Utilities.logError(ctx, BLANK, new Exception(t));
			}
		}.start();
	}
}